<?php #20080410 http://www.framework.altervista.org/FrameWork/blocks/top/02_hmenu.inc
define('BLOCKHMENU','2.00');

/************************************************************************/
/* FrameWork  test preview                                              */
/* ==================================================================== */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/


$theme=theme();

//hmenu.inc

//carica la lingua se esiste

$lang=lang();
switch($lang){
    case "en":
	define("_COMBOMENU","Other .....");
	break;

    default:
	define("_COMBOMENU","Altro .....");
	break;
}

?>

<div>

<div class='linguetta-body'>

<?php

    $fd=opendir("applications");
    while (false !== ($appname= readdir($fd))){
	if ($appname[0]!='.' && $appname[0]!='_')
	    $applist[$i++]=$appname;
    }
    closedir($fd);
    sort($applist);
    if(strpos(" ".$_SERVER['HTTP_USER_AGENT'],"MSIE"))$style="padding-top: 3px;";
    $a=0;
    foreach($applist as $appelement){
	$apptitle=apptitle($appelement); $accesskey=GetAccessKey($apptitle, $appelement);
	$appname=appname();

if (get_config("menugraphics/b-block_top_simplix_menu","")=="on"){
	echo "<span style=\"$style\" ><a accesskey=\"$accesskey\" href='index.php?appname=$appelement' >$apptitle </a></span>";
	} else if (get_config("menugraphics/b-block_top_simplix_menu","")==""){
	if ($a==8){
	    echo "<select class='linguetta' class='select' onChange=\"location=''+this.value;\" >\n";
     	    echo "<option value='index.php?'>"._COMBOMENU."</option>\n";
	}
	if ($a>=8){
		if($appelement!="$appname")
		    echo "<option class='linguetta' value='index.php?appname=$appelement'>".apptitle($appelement)."</option>";
		else
		    echo "<option class='linguetta' selected value='index.php?appname=$appelement'>".apptitle($appelement)."</option>";
	}
	else{
	    if ($appelement!=findapp("applications",$appname)){
		if (get_config("menugraphics/b-block_top_graphic_menu","")==""){
		    echo "<span class='linguettaleft' ></span>";
		    echo "<span class='linguetta' style=\"$style\" ><a accesskey=\"$accesskey\" href='index.php?appname=$appelement' >$apptitle <IMG src='themes/$theme/images/bullet2.gif' border=0 ></a></span>";
		    echo "<span class='linguettaright'></span> ";
		}
		if (get_config("menugraphics/b-block_top_graphic_menu","")=="on"){
			if (file_exists("applications/$appelement/images/$apptitle.png")) {
				echo "<span class='linguetta sel' style=\"$style\" ><a accesskey=\"$accesskey\" href='index.php?appname=$appelement' >$apptitle <IMG src='applications/$appelement/images/$apptitle.png' border=0 width='40' height='40' Hspace='0' Vspace='0' title='$apptitle' ></a></span>";
			}
			else {
				if (file_exists("applications/$appelement/_images/$apptitle.png")) {
					echo "<span class='linguetta sel' style=\"$style\" ><a accesskey=\"$accesskey\" href='index.php?appname=$appelement' >$apptitle <IMG src='applications/$appelement/_images/$apptitle.png' border=0 width='40' height='40' Hspace='0' Vspace='0' title='$apptitle' ></a></span>";
				}
				else{
					echo "<span class='linguetta sel' style=\"$style\" ><a accesskey=\"$accesskey\" href='index.php?appname=$appelement' >$apptitle <IMG src='themes/$theme/images/default_apptitle.png' border=0 width='40' height='40' Hspace='0' Vspace='0' title='$apptitle' ></a></span>";
				}
			}
		}
	    }
	    else{
		if (get_config("menugraphics/b-block_top_graphic_menu","")==""){
		    echo "<span class='linguettaleft'></span>";
		    echo "<span class='linguetta sel' style=\"$style\" ><a accesskey=\"$accesskey\" href='index.php?appname=$appelement' >$apptitle <IMG src='themes/$theme/images/bullet2.gif' border=0 ></a></span>";
		    echo "<span class='linguettaright'></span> ";
		}
		if (get_config("menugraphics/b-block_top_graphic_menu","")=="on"){
			if (file_exists("applications/$appelement/images/$apptitle.png")) {
				echo "<span class='linguetta sel' style=\"$style\" ><a accesskey=\"$accesskey\" href='index.php?appname=$appelement' >$apptitle <IMG src='applications/$appelement/images/$apptitle.png' border=0 width='40' height='40' Hspace='0' Vspace='0' title='$apptitle' ></a></span>";
			}
			else{
				if (file_exists("applications/$appelement/_images/$apptitle.png")) {
					echo "<span class='linguetta sel' style=\"$style\" ><a accesskey=\"$accesskey\" href='index.php?appname=$appelement' >$apptitle <IMG src='applications/$appelement/_images/$apptitle.png' border=0 width='40' height='40' Hspace='0' Vspace='0' title='$apptitle' ></a></span>";
				}
				else {
					echo "<span class='linguetta sel' style=\"$style\" ><a accesskey=\"$accesskey\" href='index.php?appname=$appelement' >$apptitle <IMG src='themes/$theme/images/default_apptitle.png' border=0 width='40' height='40' Hspace='0' Vspace='0' title='$apptitle' ></a></span>";
				}
			}
			}		
		}
	}
	$a++;
    }}
    if ($a>=8){
	echo "</select>\n";
    } 
?>
</div>
</div>

